import Home from "../components/home/home";
import Category from "../containers/category/category";
import Product from "../containers/product/product";
import User from "../containers/user/user";
import Slides from "../containers/slides/slides";
import Pie from "../containers/pie/pie";
import Line from "../containers/line/line";
import Bar from "../containers/bar/bar";

import Admin from "../containers/admin/admin";
import Login from "../containers/login/login";

import { Navigate } from "react-router-dom";
import Add from "../containers/product/add";
import Update from "../containers/product/update";
import Detail from "../containers/product/detail";
const routes = [
  {
    path: "/admin",
    element: <Admin />,
    children: [
      {
        path: "home",
        element: <Home />,
      },
      { path: "category", element: <Category /> },
      { path: "product", element: <Product /> },
      { path: "product/detail/:id", element: <Detail /> },
      { path: "product/add", element: <Add /> },
      { path: "product/update/:id", element: <Update /> },
      { path: "user", element: <User /> },
      { path: "slides", element: <Slides /> },
      { path: "charts/pie", element: <Pie /> },
      { path: "charts/line", element: <Line /> },
      { path: "charts/bar", element: <Bar /> },
      { path: "", element: <Navigate to="/admin/home" /> },
    ],
  },

  { path: "/login", element: <Login /> },

  { path: "/", element: <Navigate to="/admin/home" /> },
];

export default routes;
